<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="favicon.ico">
<script src="/js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="/js/ks/css/css2.css" />

<script src="/js/day.js"></script>
<script src="/js/tool.js"></script>
<script src="/js/vue.min.js"></script>
</head>
<body>
<div id="app">
<div class="header">
  <div class="topbox">
  	<div class="logo">开考时间：{{showCreateTime}}  &nbsp;耗时：{{costMinute}}分钟</div>
  	<div class="topr">&nbsp;得分<b><span th:text="${resultScore}"></span>/<span th:text="${score}"></span>[{{markLevel}}]</b></div>
    <div class="toprt"><span>考试名称：</span>{{name}}<br><span>考生姓名：</span>{{createUserName}}</span></div>
    <div class="clear"></div>
  </div>
</div>
<div class="mainer">
  <div class="mainbox">
    <div class="ilist" v-for="(topic,index) in list">
      <div class="tit">{{(index+1)+"&nbsp;&nbsp;"+topic.text}}<span v-if="topic.score!=null&&topic.score!=''">（{{topic.score}}分）</span><span v-if="topic.right==2" style="color:green">× 【正确答案：{{topic.rightAnswer}}】</span><span v-else style="color:green">√</span></div>
      <div class="item">
        <div :class="'f ' + (topic.questionType==1?'radio':'checkbox')">
          <label v-if="topic.questionType==1" :class="selected[index][index2]" v-for="(choice,index2) in topic.choiceList"><span>{{choice.orderno}}</span>{{choice.text}}<span style="color:green;background-color: #DCDCDC" v-if="choice.answerText">【答案说明：{{choice.answerText}}】</span><input :class="selected[index][index2]" type="radio" name="radio3"></label>
          <label v-if="topic.questionType==2" :class="selected[index][index2]" v-for="(choice,index2) in topic.choiceList"><span>{{choice.orderno}}</span>{{choice.text}}<span style="color:green;background-color: #DCDCDC" v-if="choice.answerText">【答案说明：{{choice.answerText}}】</span><input :class="selected[index][index2]" type="checkbox"></label>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="footer">
</div>
</div>
<script src="/js/axios.js"></script>
<script>
    let userId = `[[${session.me.id}]]`;
	let paperCopyId = `[[${paperCopyId}]]`
	var vm = new Vue({
		el: '#app',
		data: {
			createTime:'',
			showCreateTime:0,
			costMinute:0,
			state:1,
			name:'',
			userName:'',
            createUserName:'',
			markLevel:'',
			list:[],
			selected:[]
		},mounted: function(){
			
		},methods: {
			
		}
	})
	function getList(){
		axios.get("/paperCopy/showResult",{params:{paperCopyId: paperCopyId,userId: userId}}).then(res=>{
			let data = res.data;
			vm.name = data.name;
			vm.markLevel = data.markLevel;
			vm.userName = data.userName;
			vm.createUserName = data.createUserName;
			vm.costMinute = data.costMinute;
			vm.createTime = dayjs(data.createTime);
			vm.showCreateTime = dayjs(data.createTime).format("HH:mm");
			for(var i=0;i<data.list.length;i++){
				let qc = data.list[i];
				let cList = qc.choiceList;
				var arr = [];
				for(var j=0;j<cList.length;j++){
					let cc = cList[j];
					arr[j] = cc.selected==1?"checked":"";
				}
				vm.selected.splice(i,1,arr);
			}
			vm.list = data.list;

	   })
	}
	getList();
</script>
  
</body>
</html>